package com.feri.fc.listener;

import com.feri.fc.caregiver.service.PhysicianService;
import com.feri.fc.config.RocketMQConfig;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/11/26 11:36
 * @Modified:
 */
@Component
@RequiredArgsConstructor
@Slf4j
@RocketMQMessageListener(topic = RocketMQConfig.TOPIC_REAL,consumerGroup = "real")
public class RealAuditListener implements RocketMQListener<Integer> {
    private final PhysicianService service;

    @Override
    public void onMessage(Integer id) {
        log.info("开始处理，陪诊师实名审核");
        service.audit(id);
        log.info("结束处理，陪诊师实名审核");
        //手动应答--确认消息消费--MQ服务器删除消息
        //出现异常 回复 未消费  MQ服务器不删除消息
    }
}
